{{if validation_errors()}}
<ul class="message error">
    <li>{{validation_errors()}}</li>
</ul>
{{/if}}

<div class="clear"></div>
<form class="block-content form" id="simple_form" method="post" action="create">
    <h1>{{$user->lang->line('user')}}</h1>
    <ul class="tabs js-tabs same-height">
        <li class="current"><a href="#tab-locales" title="Locales">{{$user->lang->line('current')}}</a></li>
        <li><a href="#tab-options" title="Options">{{$user->lang->line('options')}}</a></li>    
    </ul>
    <div class="tabs-content">

        <div id="tab-locales">
            {{if isset($user->id)}}{{form_hidden('id', $user->id)}}{{/if}}

            <fieldset class="grey-bg required">			
                <legend>{{$user->lang->line('required')}}</legend>
                <p>
                    <label>{{$user->localize_label('username')}} {{if isset($user->id)}}<font color="Green">{{if isset($user->username)}}{{$user->username}}{{/if}}</font>{{/if}} {{if isset($user->username)}} - <a href="{{site_url()}}auth/user/change_password/id/{{$user->id}}" >[Thay đổi mật khẩu]</a>{{/if}}</label>
                        {{if !isset($user->id)}}
                    <input type="text" name="username" id="simple-required" value="{{if isset($user->username)}}{{$user->username}}{{/if}}" class="full-width">
                    {{/if}}
                </p>

                {{if !isset($user->id)}}
                <p>
                    <label>{{$user->localize_label('password')}} </label>				
                    <input type="password" name="password" class="full-width" value="">
                    {{form_error('password')}}				
                </p>

                <p>
                    <label>{{$user->localize_label('confirm_password')}} </label>				
                    <input type="password" name="confirm_password" class="full-width" value="">		
                    {{form_error('confirm_password')}}				
                </p>
                {{/if}}

                <p>
                    <label>{{$user->localize_label('email')}} </label>
                    <input type="text" name="email" id="simple-required" value="{{if isset($user->email)}}{{$user->email}}{{/if}}" class="full-width">
                    {{form_error('email')}}
                </p>
                <p>
                    <label>{{$user->lang->line('group')}} </label>
                    <select name="group_id" id="simple-select" class="full-width">
                        {{foreach $user->group_list() as $item}}
                        <option value="{{$item@key}}" {{if (isset($user->group_id)) and ($user->group_id == $item@key)}}selected="selected"{{/if}}>{{$item}}</option>
                        {{/foreach}}
                    </select>
                </p>
            </fieldset>
        </div>
        <div id="tab-options">
            <fieldset>
                <legend>{{$user->lang->line('other_info')}}</legend>

                <p>
                    <label>{{$user->localize_label('firstname')}} </label>
                    <input type="text" name="firstname" class="full-width" value="{{if isset($user->firstname)}}{{$user->firstname}}{{/if}}">
                </p>

                <p>
                    <label>{{$user->localize_label('lastname')}} </label>				
                    <input type="text" name="lastname" class="full-width" value="{{if isset($user->lastname)}}{{$user->lastname}}{{/if}}">				
                </p>

                <p>
                    <label>{{$user->localize_label('address')}} </label>				
                    <input type="text" name="address" class="full-width" value="{{if isset($user->address)}}{{$user->address}}{{/if}}">				
                </p>

                <p>
                    <label>{{$user->localize_label('phone')}} </label>				
                    <input type="text" name="phone" class="full-width" value="{{if isset($user->phone)}}{{$user->phone}}{{/if}}">				
                </p>

                <p>
                    <label>{{$user->localize_label('image')}} </label>				
                    <input type="text" name="image" class="full-width" value="{{if isset($user->image)}}{{$user->image}}{{/if}}">				
                </p>

                <p>
                    <label>{{$user->localize_label('gender')}} </label>
                    <select name="gender" id="simple-select" class="full-width">
                        {{foreach $user->gender_list() as $item}}
                        <option value="{{$item@key}}" {{if (isset($user->gender)) and ($user->gender == $item@key)}}selected="selected"{{/if}}>{{$item}}</option>
                        {{/foreach}}
                    </select>
                </p>
                <p>
                    <label for="simple-select">{{$user->lang->line('language')}}</label>
                    <select name="lang_id" id="simple-select" class="full-width">					
                        {{html_options options=$language->get_list() selected=$user->language_id}}
                    </select>
                </p>
                <p>
                    <label for="image">{{$user->lang->line('creator')}} </label>				
                    <input type="text" name="creator_id" class="full-width" value="">				
                </p>
                <div class="columns">
                    <div class="colx2-left">
                        <label for="content">{{$user->lang->line('simple-calendar')}} </label>
                        <span class="input-type-text margin-right relative">
                            <input type="text" name="simple-calendar" id="simple-calendar" value="">
                            <img  src="{{base_url()}}data/templates/backend/xgo/images/icons/fugue/calendar-month.png" width="16" height="16">
                        </span> 

                    </div>
                    <p class="colx2-right">					
                        <label for="active">{{$user->lang->line('active')}} </label>
                        <input type="checkbox" name="active" id="simple-switch-on" value="1" checked="checked" class="switch" onclick="$(this).setActive();">
                    </p>
                </div>

            </fieldset>
        </div>
        <br/><br/><br/><br/>
        <fieldset class="grey-bg no-margin">
            <legend>{{$user->lang->line('action')}}</legend>
            <p class="input-with-button">
                <button type="submit">{{$user->lang->line('save')}}</button>
            </p>
        </fieldset>	

    </div>
</form>
